package com.ocean.recommendationserver.realtimerecommend.controller;


import com.alibaba.fastjson.JSONObject;
import com.ocean.recommendationserver.realtimerecommend.entity.Movie;
import com.ocean.recommendationserver.realtimerecommend.result.Result;
import com.ocean.recommendationserver.realtimerecommend.service.IMovieService;
import com.ocean.recommendationserver.realtimerecommend.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ocean
 * @since 2021-07-18
 */
@RestController
@RequestMapping("/movie")
public class MovieController {

    @Autowired
    private IMovieService movieService;

    @PostMapping("/getMoviesByPage")
    public Result<PageUtils> getAMoviesByPage(@RequestBody JSONObject params) {
        PageUtils moviesByPage = movieService.getMoviesByPage(params.getInteger("page"), params.getInteger("limit"));
        return Result.success(moviesByPage);
    }
}
